import type * as T from './type'
import http from '@/utils/http'
export type * from './type'

const BASE_URL = '/system/testPaper'
/** @desc 查询課程列表 */
export function listTestPaper(query: T.TestPaperQuery) {
  return http.get<PageRes<T.TestPaperPageQuery[]>>(`${BASE_URL}/page`, query)
}
export function recyclePages(query: T.TestPaperQuery) {
  return http.get<PageRes<T.TestPaperPageQuery[]>>(`${BASE_URL}/recyclePage`, query)
}

/** @desc 根據單元編號查询課程集合 */
export function getByUnitIdTestPapers(query: any) {
  return http.get<T.TestPaperDto[]>(`${BASE_URL}/list`,query)
}


/** @desc 查询課程详情 */
export function getTestPaper(id: string) {
  return http.get<T.TestPaperDto>(`${BASE_URL}/getData/${id}`)
}

/** @desc 新增課程 */
export function addTestPaper(data: any) {
  return http.post(`${BASE_URL}/create`, data)
}

/** @desc 修改課程 */
export function updateTestPaper(data: any) {
  return http.post(`${BASE_URL}/modify`, data)
}

/** @desc 逻辑删除課程 */
export function logicDeleteTestPaper(ids: string | Array<string>) {
  return http.del(`${BASE_URL}/logicDeleteTestPaper/${ids}`)
}

/** @desc 删除課程 */
export function deleteTestPaper(ids: string | Array<string>) {
  return http.del(`${BASE_URL}/delete/${ids}`)
}


